home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / pascal / savage.zip / SAVAGE.PAS < prev    next >
Pascal/Delphi Source File  |  1991-04-03  |  530b  |  30 lines

  1. program savage;
  2.  
  3. (*$I timerd12.inc *)
  4.  
  5. const
  6.   iloop = 2500;
  7. var
  8.   i : longint;
  9.   a : real;
  10.  
  11.   function tan (a:real) : real;
  12.  
  13.   begin
  14.     tan := sin (a) / cos (a);
  15.   end;
  16.  
  17. begin
  18.   write ('start...');
  19.     a := 1.0;
  20.       timer(start);
  21.         for i := 1 to iloop - 1 do
  22.           begin
  23.             a := tan(arctan(exp(ln(sqrt(a * a))))) + 1;
  24.           end;
  25.       timer(stop);
  26.     writeln ('stop');
  27.     writeln ('elapsed time is ',ElapsedTime:10:2,' seconds');
  28.     writeln ('A =',a/iloop : 15:14);
  29. end.
  30.